<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/echarts.js"></script>
    <!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5/dist/echarts.min.js"></script> -->
</head>
<body>
    <div id="main" style="width: 700px; height: 500px;"></div>

    <script>
        var Myecharts = echarts.init(document.getElementById("main"));
        option = {
            legend:{
                left:30,
                data:['意向',"预购","成交"],
           },
        //    显示数据
           tooltip: {
                trigger: 'axis'
            },
           toolbox:{
               show:true,
               feature: {
                    // dataView: {show: true, readOnly: false},
                    magicType: {
                        show: true, 
                        type: ['line', 'bar', 'stack', 'tiled'],
                        title:{
                            line:"切换为折线图",
                            bar:"切换为柱状图",
                            stack:"切换为堆叠",
                            tiled:"切换为平铺",
                        },
                    },
                    // 恢复
                    restore: {show: true,title:'恢复'},
                    // 下载
                    // saveAsImage: {show: true,title:'保存为图片下载'}
                    
                }
           },
            xAxis: {
                type: 'category',
                data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
            },
            yAxis: {
                type: 'value'
            },
            series: [{
                name:'意向',
                data: [1350, 1200, 800, 280, 200, 180, 50],
                type: 'line',
                areaStyle:{normal:{}},
                smooth:true,
            },
            {
                name:'预购',
                data: [20, 200, 500, 810, 750, 700, 850],
                type: 'line',
                areaStyle:{normal:{}},
                smooth:true,
            },
            {
                name:'成交',
                data: [20, 40, 80, 100, 300, 600, 500],
                type: 'line',
                areaStyle:{normal:{}},
                smooth:true,
            }],
           
        };
        //    渲染图表
        Myecharts.setOption(option);
    </script>
</body>
</html>